<div class="col-sm-12 col-md-12">

<div class="row">
        <div class="col-sm-12 col-md-12">
            <form class="form-custom clearfix">
	        <div class="col-sm-2 col-md-2">
	            <input class="form-control"  type="text" placeholder="手机号" ng-model="params.mUserTel"/>       
	        </div>   
                <div class="col-sm-3 col-md-3">
	                <button class="btn btn-custom" type="submit" ng-click="refresh('first',true)">查询</button>            
                </div>
            </form>
        </div>
     </div>   

    <table class="table table-striped table-bordered table-condensed index-center  table-costom">
        <thead>
        <tr>
            <th width="40">序号</th>
            <th width="60">用户id</th>
            <th width="40">用途</th>
            <th width="80">类型</th>
            <th>申请贷款金额</th>
            <th width="40">期限</th>
            <th>每月可还</th>
            <th>贷款利率</th>
            <th>状态</th>
            <th>申请日期</th>
            <th>放款日期</th>
            <th style="width:220px">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr class="rowlink" ng-repeat="item in limitArr">
            <td>{{current*limit+$index+1}}</td>
            <td>{{item.mUserId}}</td>
            <td>{{item.useage}}</td>
            <td ng-if="item.type==0" style="color:red">授信贷款</td><td ng-if="item.type==1">信用贷款</td><td ng-if="item.type==2">抵押贷款</td><td ng-if="item.type==3">担保贷款</td>
            <td>{{item.amount}}</td>
            <td>{{item.period}}</td>
            <td>{{item.repayment}}</td>
            <td>{{item.rate}}</td>
            <td ng-if="item.status==0">待审查</td><td ng-if="item.status==1">审查通过</td><td ng-if="item.status==2">已还款</td><td ng-if="item.status==3">已平仓</td>
            <td>{{item.createTime|date:'yyyy-MM-dd'}}</td>
            <td>{{item.giveDate|date:'yyyy-MM-dd'}}</td>
            <td ng-if="item.status==0 && item.type>0">
                <a href="javascript:" data-toggle="modal" data-target="#preview" ng-click="preview(item)">预览</a>
                <a href="javascript:" data-toggle="modal" data-target="#audit" ng-click="audit(item.mUserId, item.loanId)">资质审查</a>
                <a href="javascript:" data-toggle="modal" data-target="#approve" ng-click="approve(item)">贷款项目审批</a> 
                <a href="javascript:" data-toggle="modal" data-target="#removeDialog" ng-click="todelete(item.loanId)">删除</a>
            </td>
            <td ng-if="item.status==1 && item.type>0">
                <a href="javascript:" data-toggle="modal" data-target="#preview" ng-click="preview(item)">预览</a>
                <a href="javascript:" data-toggle="modal" data-target="#audit" ng-click="audit(item.mUserId, item.loanId)">资质审查</a>
                <a href="javascript:" data-toggle="modal" data-target="#next" ng-click="investment(item.loanId)">投资</a>
            </td>
            <td ng-if="item.status==0 && item.type==0">
                <a href="javascript:" data-toggle="modal" data-target="#preview" ng-click="preview(item)">预览</a>
                <a href="javascript:" data-toggle="modal" data-target="#removeDialog" ng-click="todelete(item.loanId)">删除</a>
            </td>
            <td ng-if="item.status>0 && item.type==0">
                <a href="javascript:" data-toggle="modal" data-target="#preview" ng-click="preview(item)">预览</a>
            </td>
        </tr>
        </tbody>
    </table>
            <div data-remote-paging="pager" 
					data-refresh="refresh" 
					data-current="current" 
					data-total="total" 
					data-data="limitArr"
					data-limit="limit"
					data-params="params"
			></div>
</div>

<!-- 贷款项目审批  -->
<div class="modal fade" id="approve" tabindex="-1" role="dialog" aria-hidden="true">
<form class="form-horizontal" name="editForm" novalidate="novalidate" ng-submit="approveUpdate(loan)" >
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4  class="modal-title">贷款项目审批</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12 col-md-12">
			            <h4 class="heading">贷款审批</h4>
	                    <div class="form-group">
	                        <label class="col-lg-2 control-label">贷款状态：</label>
	                        <div class="col-lg-9">
	                            <label class="radio-inline"><input type="radio" class="" ng-model="loan.status" value="0" name="state"/>待审查</label>
	                            <label class="radio-inline"><input type="radio" class="" ng-model="loan.status" value="1" name="state"/>审查通过</label>
	                        </div>
	                    </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">放款额度</label>
                            <div class="col-lg-9">
                                <input type="number" placeholder="" required ng-model="loan.totalAmount" name="totalAmount" class="form-control">
                            </div>
                            <span class="mustItem">*</span>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">周期</label>
                            <div class="col-lg-9">
			                    <input type="number" class="form-control" required ng-model="loan.period" ng-maxlength="50" ng-trim maxlength="50" />
                            </div>
                            <span class="mustItem">*</span>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">贷款利率</label>
                            <div class="col-lg-9">
                                <input type="number" placeholder="" required ng-model="loan.rate" name="rate" class="form-control">
                            </div>
                            <span class="mustItem">*</span>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">放款日期</label>
			                <div class="col-lg-3">
			                    <div data-datetimepicker='loan.giveDate' ng-model="loan.giveDate" required></div>
                            </div>
                            <span class="mustItem">*</span>
		                </div>
			            <h4 class="heading">项目审批</h4>
						<div class="form-group">
			                <label class="col-lg-2 control-label">项目编码</label>
                            <div class="col-lg-9">
                                <input type="text" placeholder="" required ng-model="loan.itemSN" name="itemSN" class="form-control">
                            </div>
                            <span class="mustItem">*</span>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">年化利率</label>
                            <div class="col-lg-9">
                                <input type="number" placeholder="" required ng-model="loan.annualizedRate" name="annualizedRate" class="form-control">
                            </div>
                            <span class="mustItem">*</span>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">还款方式</label>
                            <div class="col-lg-9">
                                <input type="text" placeholder="到期还本，每月付息" required ng-model="loan.paymentMethod" name="paymentMethod" class="form-control">
                            </div>
                            <span class="mustItem">*</span>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">保障方式</label>
                            <div class="col-lg-9">
                                <input type="text" placeholder="100%本息担保" required ng-model="loan.guaranteeMethod" name="guaranteeMethod" class="form-control">
                            </div>
                            <span class="mustItem">*</span>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">最小投资额</label>
                            <div class="col-lg-9">
			                    <input type="number" class="form-control" required ng-model="loan.investmentAmountMin" ng-maxlength="50" ng-trim maxlength="50" />
                            </div>
                            <span class="mustItem">*</span>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">项目介绍</label>
                            <div class="col-lg-9">
                                <textarea class="form-control" rows="4" ng-model="loan.itemDesc" ></textarea>
                            </div>
		                </div>
                        <div class="form-group">
			                <label class="col-lg-2 control-label">起始日期</label>
			                <div class="col-lg-3">
                                <div data-datetimepicker="loan.startDate" ng-model="loan.startDate" required></div>
                            </div>
                            <span class="mustItem">*</span>
			                <label class="col-lg-2 control-label">结束日期</label>
			                <div class="col-lg-3">
                                <div data-datetimepicker="loan.endDate" ng-model="loan.endDate" required></div>
                            </div>
                            <span class="mustItem">*</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" ng-disabled="editForm.$invalid">确认</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    </form>
    <!-- /.modal-dialog -->
</div>

<!-- 资质审查 -->
<div class="modal fade" id="audit" tabindex="-1" role="dialog" aria-hidden="true">
<form class="form-horizontal" name="addSyncApplForm" novalidate="novalidate" ng-submit="create(useritem)" >
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4  class="modal-title">资质审查</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12 col-md-12">
						<input type="hidden" ng-model="useritem.status" />
						<div class="form-group">
			                <label class="col-lg-2 control-label">用户名</label>
			                <div class="col-lg-3">
				                {{mobileUser.mUserName}}
			                </div>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">工作证明</label>
			                <div class="col-lg-4">
								<img class="img-thumbnail" ng-src="{{imgShow(useritem.jobCertification)}}" style="width: 150px; height:149px;"/>
			                </div>
			                <label class="col-lg-2 control-label">收入证明</label>
			                <div class="col-lg-4">
								<img class="img-thumbnail" ng-src="{{imgShow(useritem.incomeCertification)}}" style="width: 150px; height:149px;"/>
			                </div>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">房产证明</label>
			                <div class="col-lg-3">
								<img class="img-thumbnail" ng-src="{{imgShow(useritem.housingCertification)}}" style="width: 150px; height:149px;"/>
			                </div>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">信用资质</label>
			                <div class="col-lg-3">
			                    <input type="text" class="form-control" ng-model="useritem.creditLevel" ng-maxlength="50" ng-trim maxlength="50" />
			                </div>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">用户类型</label>
			                <div class="col-lg-3">
				                <select ng-model="useritem.type" select2 class="form-control">
				                    <option value="0">个人</option>
				                    <option value="1">企业</option>
				                </select>
                            </div>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">姓名/单位</label>
			                <div class="col-lg-3">
			                    <input type="text" class="form-control" ng-model="useritem.organization" ng-maxlength="50" ng-trim maxlength="50" />
			                </div>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">单位地址</label>
			                <div class="col-lg-3">
			                    <input type="text" class="form-control" ng-model="useritem.orgAddress" ng-maxlength="50" ng-trim maxlength="50" />
			                </div>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">工作/企业性质</label>
			                <div class="col-lg-3">
			                    <input type="text" class="form-control" ng-model="useritem.orgProperty" ng-maxlength="50" ng-trim maxlength="50" />
			                </div>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">月收入</label>
			                <div class="col-lg-3">
			                    <input type="number" class="form-control" ng-model="useritem.salary" ng-maxlength="50" ng-trim maxlength="50" />
			                </div>
		                </div>
						<div class="form-group">
			                <label class="col-lg-2 control-label">备注</label>
                            <div class="col-lg-9">
                                <textarea class="form-control" rows="4" ng-model="useritem.remark" ></textarea>
                            </div>
		                </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" ng-disabled="addSyncApplForm.$invalid">保存</button>
                <!-- button type="submit" class="btn btn-primary" ng-disabled="addSyncApplForm.$invalid" ng-click="setStatus(1)">审核通过</button-->
                <!-- button type="submit" class="btn btn-primary" ng-disabled="" ng-click="setStatus(2)">审核未通过</button-->
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    </form>
    <!-- /.modal-dialog -->
</div>

<!-- 预览 -->
<div class="modal fade" id="preview" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;height:392px; ">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">预览</h4>
            </div>
            <div class="modal-body">
            	<div class="col-sm-12 col-md-12">
	            <form role="form" class="form-horizontal">
	                <h4 class="heading">产品名称： {{keyv.productName}}</h4>
	                <div class="form-group">&nbsp;</div>
           			<div class="form-group"  style=" height:332px; ">
                        <p class="col-lg-6">
用户名：{{mobileUser.mUserName}}<br />
手机号：{{mobileUser.mUserTel}}<br />
职业：{{mobileUser.occupation}}<br />
年龄：{{mobileUser.age}}<br />
性别：{{mobileUser.sex}}<br />
身份证号：{{mobileUser.idNumber}}<br />
余额：{{mobileUser.mUserMoney}}<br />
冻结资金：{{mobileUser.frozenMoney}}<br />
紧急联系人：{{mobileUser.emergencyName}}<br />
注册时间：{{mobileUser.createTime|date:'yyyy-MM-dd'}}<br />
<br />
用途：{{keyv.useage}}<br />
类型：{{keyv.type}}<br />
贷款金额：{{keyv.amount}}<br />
期限：{{keyv.period}}<br />
贷款利率：{{keyv.rate}}<br />
审核状态：{{keyv.status}}<br />
申请日期：{{keyv.createTime|date:'yyyy-MM-dd'}}<br />
<br />
项目编码：{{loanItem.itemSN}}<br />
放款额度：{{loanItem.totalAmount}}<br />
放款日期：{{loanItem.giveDate}}<br />
年化利率：{{loanItem.annualizedRate}}<br />
还款方式：{{loanItem.paymentMethod}}<br />
保障方式：{{loanItem.guaranteeMethod}}<br />
最小投资额：{{loanItem.investmentAmountMin}}<br />
周期（月）：{{loanItem.period}}<br />
项目介绍：{{loanItem.itemDesc}}<br />

                        </p>  
                  	</div>
                   <div class="form-group">&nbsp;</div>
	            </form>
	            </div> <!-- col-sm-12 col-md-12 end -->
            </div><!-- modal-conteng end -->
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 删除对话框 -->
<div class="modal fade" id="removeDialog" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">删除</h4>
            </div>
            <div class="modal-body">
                                                     确认要删除么？
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" ng-click="comfirmDelete()" data-dismiss="modal">确认删除</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 输入移动用户id -->
<div class="modal fade" id="next" tabindex="-1" role="dialog" aria-hidden="true">
<form class="form-horizontal" name="redpacketForm" novalidate="novalidate" ng-submit="next(muid)" >
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">输入移动用户id</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12 col-md-12">
                        <div class="form-group">
			                <div class="col-lg-9">
			                    <input type="text" class="form-control" required ng-model="muid" ng-maxlength="50" ng-trim maxlength="50"/>
			                </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" ng-disabled="redpacketForm.$invalid">下一步</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    </form>
    <!-- /.modal-dialog -->
</div>

<!-- 投资 -->
<div class="modal fade" id="itemInvestment" tabindex="-1" role="dialog" aria-hidden="true">
<form class="form-horizontal" name="investmentForm" novalidate="novalidate" ng-submit="saveInvestment(key)" >
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">投资</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12 col-md-12">
                        <div class="form-group">
	                        <label class="col-lg-2 control-label">选择红包</label>
			                <div class="col-lg-9">
			                    <select class="form-control" ng-model="key.redpacket" select2 data-live-search="true"
			                     ng-options="item.redpacketAmount for item in redpackets track by item.redpacketId">
									<option value=""></option>
			                    </select>
			                </div>
                        </div> 
                        <div class="form-group">
			                <label class="col-lg-2 control-label">投资金额</label>
			                <div class="col-lg-9">
			                    <input type="text" class="form-control" ng-model="key.investmentAmount" ng-maxlength="50" ng-trim maxlength="50" />
			                </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" ng-disabled="investmentForm.$invalid">保存</button>
                <button type="button" class="btn btn-danger" ng-click="clearForm()">重置</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    </form>
    <!-- /.modal-dialog -->
</div>
